from mnist_dataset import x_train, y_train, shape_
import matplotlib.pyplot as plt

plt.figure(figsize=[16, 8])
spn = 0
spr = 5
spc = 10


def check_i(i):
    global spn
    spn += 1
    plt.subplot(spr, spc, spn)
    plt.axis('off')
    plt.title(f'{i}: {y_train[i]}')
    plt.imshow(x_train[i].reshape(*shape_))


half = spr * spc // 2
for i in range(half):
    check_i(i)

for i in range(half):
    check_i(-(i+1))

print('Check and close the plotting window to continue ...')
plt.show()
